package src.Fifteen;

public class ThreadState implements Runnable{
    @Override
    public void run() {
        try {
            waitForASecond();
            waitForYears();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public synchronized void waitForASecond() throws InterruptedException {
        wait(500);
    }

    public synchronized void waitForYears() throws InterruptedException {
        wait();
    }

    public synchronized void notifyNow(){
        notify();
    }

}
